<?php

declare(strict_types=1);

namespace Modules\Production\Models;

use Catch\Base\CatchModel as Model;

/**
 * @property $id
 * @property $order_id
 * @property $material_no
 * @property $qty
 * @property $lot_num
 * @property $location
 * @property $to_lot_num
 * @property $creator_id
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
*/
class StockTaskScan extends Model
{


    protected $table = 'stock_task_scan';

    protected $fillable = [ 'id', 'order_id', 'material_no', 'qty', 'lot_num', 'location', 'to_lot_num','inv_id','push_kingdee', 'creator_id', 'created_at', 'updated_at', 'deleted_at' ];

    /**
     * @var array
     */
    protected array $fields = ['id','order_id','material_no','qty','lot_num','location','to_lot_num','inv_id','push_kingdee','created_at'];

    /**
     * @var array
     */
    protected array $form = ['id','order_id','material_no','qty','lot_num','location','to_lot_num','inv_id','push_kingdee','created_at','updated_at'];

    /**
     * @var array
     */
    public array $searchable = [
        'order_id'      => '=',
        'material_no'   => '=',
        'lot_num'       => '=',
        'location' => '=',
        'to_lot_num' => '=',
    ];

    /**
     * 时间格式化
     * @param $date
     * @return mixed
     */
    protected function serializeDate($date)
    {
        return $date->format('Y-m-d H:i');
    }



}
